/*  -*- mode: c++; coding: utf-8; c-file-style: "stroustrup"; -*-

    Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
    This file is part of Intromit.

    Intromit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Intromit is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Intromit.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PYMETADATA_VECTOR_HH
#define PYMETADATA_VECTOR_HH
//! \addtogroup python_backend
//@{

// INCLUDES
#include <Python.h>

// DECLARATIONS
class python_metadata;

// CLASSES

//! Class to be returned instead of a list inside python interpreter
//! When python_metadata has obj_container, this object is not used
class python_vector
{
    PyObject *pylist;

    // ** PRIVATE FUNCTIONS **
    void ctor();
    void dtor();


public:
    python_vector();
    ~python_vector();

    static bool get_info(python_metadata *pyobj, int *n, int *size, int **pos_type_metadata);
    static void *get_closure(python_metadata *pyobj);
    static int set_list(PyObject *self, PyObject *list);
    static PyObject *get_list(PyObject *self, int only_i=-1);
    static PyObject *__repr__(PyObject *self);
    static PyObject *__getitem__(PyObject *self, int i);
    static int __setitem__(PyObject *self, int i, PyObject *value);
    static PyObject *__getstate__(PyObject *self);
    static PyObject *__setstate__(PyObject *self, PyObject *args);
    static PyObject *__reduce__(PyObject *self);
    static PyObject *__reduce_ex__(PyObject *self, PyObject *args);
    static int __len__(PyObject *self);
    static int __cmp__(PyObject *self, PyObject *value);
    static PyObject *__richcmp__(PyObject *self, PyObject *value, int function);
};

//@}
#endif

/* Offline metadata attributes:

   @metadata_attrs(
	python_vector
	{
		# methods
		__repr__,
		__getitem__,
		__setitem__,
		__getstate__,
		__setstate__,
		__reduce__,
		__reduce_ex__,
		__len__,
		__cmp__,
		__richcmp__:
						select, nowrap
	}
   )
*/

